package cn.e3mall.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.e3mall.common.pojo.EasyUITreeNode;
import cn.e3mall.service.ItemCatService;

@Controller
public class ItemCatController {

	@Autowired
	private ItemCatService itemCatService;

	/** 
	 * @description 根据parentId来获取节点信息
	 * @param parentId
	 * @return
	 * @exception
	 * @author JiangBin
	 * @date 2018年2月25日 下午8:41:11
	 * @version 1.0.0
	 */
	@RequestMapping("/item/cat/list")
	@ResponseBody
	public List<EasyUITreeNode> getItemCatList(@RequestParam(value = "id", defaultValue = "0") long parentId) {
		List<EasyUITreeNode> list = itemCatService.getCatList(parentId);
		return list;
	}
}
